Skip to content

feat: Propagate traceId to the Cocoa SDK#2106

Merged
bitsandfoxes merged 50 commits intomainfrom
feat/cocoa-sync-trace-id
Apr 22, 2025
Merged

feat: Propagate traceId to the Cocoa SDK#2106
bitsandfoxes merged 50 commits intomainfrom
feat/cocoa-sync-trace-id

Conversation

@bitsandfoxes
Copy link
Copy Markdown
Contributor

With this change the Unity SDK is propagating the trace down to the Cocoa SDK. This allows connecting native errors and crashes with the ones from within the game.

Relies on getsentry/sentry-cocoa#5081

Screenshot 2025-04-10 at 14 45 13

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 5a49697

return cString;
}

void SentryNativeBridgeSetTrace(const char *traceId, const char *spanId)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the iOS and Mac bridges the same? I wonder if we could use symlinks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, they are not. Functionally, yes, but we load the lib dynamically on macOS:

/*******************************************************************************/
/* The remaining code is a copy of iOS/SentryNativeBridge.m with changes to */
/* make it work with dynamically loaded classes. Mainly: */
/* - call: [class performSelector:@selector(arg1:arg2:) */
/* withObject:arg1Value withObject:arg2Value]; */
/* or xCode warns of class/instance method not found */
/* - use `id` as variable types */
/* - use [obj setValue:value forKey:@"prop"] instead of `obj.prop = value` */
/*******************************************************************************/

@bitsandfoxes bitsandfoxes merged commit d32cf36 into main Apr 22, 2025
10 checks passed
@bitsandfoxes bitsandfoxes deleted the feat/cocoa-sync-trace-id branch April 22, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants